package com.yootk.action.data;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;

@Controller
@RequestMapping("/pages/data/*")
public class DataAction {
    private static final Logger LOGGER = LoggerFactory.getLogger(DataAction.class) ;
    @RequestMapping("set_data")
    public String setData(RedirectAttributes attributes){
        attributes.addFlashAttribute("name","张三") ;
        attributes.addFlashAttribute("url","com.yootk") ;
        return "redirect:/pages/data/setDate" ;
    }
    @RequestMapping("setDate")
    public String setDate(ModelMap map){
        LOGGER.info("参数接受：{}",map);
        return "/pages/data/show.jsp" ;
    }
}
